package com.mall.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mall.dubbo.mapper.PmsProductCategoryAttributeRelationMapper;
import com.mall.model.domain.PmsProductCategoryAttributeRelation;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author xyiaao
 * @description 针对表【pms_product_category_attribute_relation(产品的分类和属性的关系表，用于设置分类筛选条件（只支持一级分类）)】的数据库操作Api实现
 * @createDate 2022-03-29 19:46:09
 */
@DubboService
public class PmsProductCategoryAttributeRelationApiImpl extends ServiceImpl<PmsProductCategoryAttributeRelationMapper, PmsProductCategoryAttributeRelation>
        implements PmsProductCategoryAttributeRelationApi {

    @Autowired
    private PmsProductCategoryAttributeRelationMapper relationMapper;

    @Override
    public List<PmsProductCategoryAttributeRelation> findByCategoryId(Long categoryId) {

        LambdaQueryWrapper<PmsProductCategoryAttributeRelation> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(PmsProductCategoryAttributeRelation::getProductCategoryId, categoryId);
        List<PmsProductCategoryAttributeRelation> relationList = relationMapper.selectList(queryWrapper);
        return relationList;
    }

}




